Skip to main content

Toaster

Displays a non-intrusive toast notification to the user. Typically used for success, error, info, or warning messages.


๐Ÿงฉ Overviewโ€‹

The Toaster component provides short, transient messages that appear on the screen to inform users about the result of an action or system status without interrupting Pageflows. These messages automatically disappear after a specified duration.


โš™๏ธ Configuration Optionsโ€‹

PropertyDescriptionRequiredExample
MessageThe text content displayed in the toast notificationYes"Data saved successfully"
Timer (Ms)Duration the toast remains visible in millisecondsYes3000 (3 seconds)

๐Ÿ”„ Usage Exampleโ€‹

  1. Trigger a toaster notification after a user action, such as saving a form.
  2. Display the message with appropriate content.
  3. Automatically hide the toast after the specified timer elapses.

๐Ÿงช Example Implementation (JavaScript/React)โ€‹

function showToast(message, duration) {
// Example using a toast library or custom implementation
toast(message, {
autoClose: duration,
position: "top-right",
type: "success",
});
}

// Usage
showToast("Data saved successfully", 3000);

๐ŸŽจ Appearance and Behaviorโ€‹

  • Appears briefly in a corner of the UI (usually top-right or bottom-right)
  • Does not block user interactions
  • Supports different message types (success, error, warning, info) with different colors/icons
  • Smooth fade-in and fade-out animations

๐Ÿง  Best Practicesโ€‹

  • Keep messages concise and clear
  • Use appropriate timer values to allow users enough time to read
  • Avoid showing too many toasts at once to prevent clutter
  • Ensure toasts are accessible (e.g., screen reader friendly)
  • Provide consistent styling across the application

๐Ÿ”š Summaryโ€‹

The Toaster component is an essential UX pattern for lightweight, non-intrusive feedback. Proper configuration and usage improve user awareness without disrupting their Pageflows.


Next Steps:

  • Combine with Show Message for modal or alert dialogs
  • Use Action Logs to track important notifications